﻿using RemoteTestRunner.BusinessLogic.Views;

namespace RemoteTestRunner.FormsUI.Wpf
{
    public class FolderBrowserDialogService : IFolderBrowserDialogService
    {
        public string ShowFolderBrowserDialog(string initialDirectory)
        {
            using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
            {
                dialog.SelectedPath = initialDirectory;

                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    return dialog.SelectedPath;
                }

                return null;
            }
        }
    }
}
